import { createStore } from 'vuex'
// 导入自动化存储包
import createPersistedstate from 'vuex-persistedstate'
import user from './modules/user'
import cart from './modules/cart'
import category from './modules/category'
// import getters from './getters'
export default createStore({
  state: {},
  getters: {},
  mutations: {},
  actions: {},
  modules: {
    user,
    cart,
    category
  },
  // 配置选项
  plugins: [
    // 配置持久化插件包
    createPersistedstate({
      key: 'rabbit-v3-143',
      paths: ['user', 'cart'] // 要持久化存储的vuex的模块
    })
  ]
})
